<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="短信消费历史" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<link href="/css/Query.css" rel="stylesheet" type="text/css">
<script src="/js/QueryList.js"></script>
<script language="javascript">
	function doSearch(){
		var year=document.getElementById("year").value;
		if(year!=null && year!=""){
			window.location="/sms/SmsHistoryList.ihtm?year="+year;
		}
	}

	function showDetail(stafferId,stafferName,year,month){
		var url="/sms/SmsHistoryDetail.ihtm?staffer_id="+stafferId+"&staffer_name="+encodeURIComponent(stafferName)+"&year="+year+"&month="+month;
		showWin(900,500,url);
	}
	function DoubleClick(it){
	}
	
	function doCancel(){
		window.close();
	}
	function doInit(){
		Window_Onload();
	}
	function checkInput(){
		if(window.event.keyCode==13){
			doSearch();
		}
	}
</script>
</head>
<body oncontextmenu="return false" onLoad="doInit();" class="sheet" style="text-align:center;">
<div class="sheet-main" style="width:860px;text-align:left;margin:auto;">
  <div class="sheet-top">
    <div class="content">
      <h2>短信消费历史</h2>
      <p>统计每位员工每个月发送的短信数量，可以查看短信发送内容</p>
    </div>
  </div>
  <div class="sheet-list">
    <div class="search-business">
      <div class="content">
	  <table width="750px">
	      <tbody>
	        <tr>
	          <td align="right">
				  <select id="year" name="year">
					<c:forEach var="item" begin="2009" step="1" end="${lastYear}" varStatus="i"><option value="${lastYear-i.index}" <c:if test="${lastYear-i.index==year}">selected</c:if>>${lastYear-i.index}</option></c:forEach>
				  </select>
				  <input type="button" value=" 查 询" onClick="doSearch();" class="buttom search-but" id="sSearchButton" name="sSearchButton">
			  </td>
	        </tr>
	      </tbody>
	    </table>
      </div>
	  <%@include file="../inc/AlertMsg.jsp"%>
      <div class="table-list">
        <table width="100%">
          <tr>
		  	<th width="8%">姓名</td>
			<th width="7%">一月</td>
			<th width="7%">二月</td>
			<th width="7%">三月</td>
			<th width="7%">四月</td>
			<th width="7%">五月</td>
			<th width="7%">六月</td>
			<th width="7%">七月</td>
			<th width="7%">八月</td>
			<th width="7%">九月</td>
			<th width="7%">十月</td>
			<th width="7%">十一月</td>
			<th width="7%">十二月</td>
			<th width="8%">合计</td>
          </tr>
				<c:forEach var="item" items="${list}" varStatus="i">
				<c:if test="${(i.index mod 2)==0}"><c:set var="trClass" value="query_list_data_tr1" /></c:if>
				<c:if test="${(i.index mod 2)!=0}"><c:set var="trClass" value="query_list_data_tr2" /></c:if>
				<tr class="${trClass}" index="${i.index+1}" style='cursor:pointer;' ondblclick='javascript:DoubleClick(this)' onClick='javascript:ClickCheck(this)' onmouseout='javascript:mouseout(this)' onmouseover='javascript:mouseover(this)'>
					<td >
						${item[1]}
						<input type="radio" name='query_checkbox' value="${item[0]}" style="display:none">
					</td>
					<td><a href="javascript:showDetail('${item[0]}','<c:out value="${item[1]}" />','${year}','1');">${item[2]}</a></td>
					<td><a href="javascript:showDetail('${item[0]}','<c:out value="${item[1]}" />','${year}','2');">${item[3]}</a></td>
					<td><a href="javascript:showDetail('${item[0]}','<c:out value="${item[1]}" />','${year}','3');">${item[4]}</a></td>
					<td><a href="javascript:showDetail('${item[0]}','<c:out value="${item[1]}" />','${year}','4');">${item[5]}</a></td>
					<td><a href="javascript:showDetail('${item[0]}','<c:out value="${item[1]}" />','${year}','5');">${item[6]}</td>
					<td><a href="javascript:showDetail('${item[0]}','<c:out value="${item[1]}" />','${year}','6');">${item[7]}</a></td>
					<td><a href="javascript:showDetail('${item[0]}','<c:out value="${item[1]}" />','${year}','7');">${item[8]}</a></td>
					<td><a href="javascript:showDetail('${item[0]}','<c:out value="${item[1]}" />','${year}','8');">${item[9]}</a></td>
					<td><a href="javascript:showDetail('${item[0]}','<c:out value="${item[1]}" />','${year}','9');">${item[10]}</a></td>
					<td><a href="javascript:showDetail('${item[0]}','<c:out value="${item[1]}" />','${year}','10');">${item[11]}</a></td>
					<td><a href="javascript:showDetail('${item[0]}','<c:out value="${item[1]}" />','${year}','11');">${item[12]}</a></td>
					<td><a href="javascript:showDetail('${item[0]}','<c:out value="${item[1]}" />','${year}','12');">${item[13]}</a></td>
					<td>${item[14]}</td>
				</tr>
				</c:forEach>
				<tr>
					<td>合计</td>
					<td>${total[0]}</td>
					<td>${total[1]}</td>
					<td>${total[2]}</td>
					<td>${total[3]}</td>
					<td>${total[4]}</td>
					<td>${total[5]}</td>
					<td>${total[6]}</td>
					<td>${total[7]}</td>
					<td>${total[8]}</td>
					<td>${total[9]}</td>
					<td>${total[10]}</td>
					<td>${total[11]}</td>
					<td>${total[12]}</td>
				</tr>
			  </table>  
      </div>     
    </div>
  </div>
</div>	
</body>
</html>